import React from 'react';
import { getOrganization } from '@/utils/utils';
import styles from './form.less';
import { FormContainer } from './FormContainer';
import FormItem from './FormItem';

const Form3 = props => {
    const {
        initialFormInfo: { companyId = 101 }
    } = props;
    const { required = true, ...otherProps } = props; // required为true和false判断走2套校验规则
    return (
        <>
            <div id="form3" className={styles.title}>
                应聘信息
            </div>
            <FormContainer>
                <FormItem
                    required={required}
                    type="inputNumber"
                    label="同岗经验/年"
                    prop="talentExperience"
                    {...otherProps}
                />
                <FormItem
                    required={required}
                    type="date"
                    label="最快到岗时间"
                    prop="comePositionDate"
                    {...otherProps}
                />
                <FormItem label="月薪要求" prop="monthSalaryDemand" {...otherProps} />
                <FormItem label="其他福利要求" prop="otherBenefitDemand" {...otherProps} />
                <FormItem
                    required={required}
                    type="notesSource"
                    dictCode={getOrganization(companyId)?.area === 'cn' ? 'ChinaRecruitWay' : 'SingaporeRecruitWay'}
                    label="应聘渠道"
                    prop={['notesSource', 'notesSourceDetail']}
                    {...otherProps}
                />
                <FormItem
                    required={required}
                    type="radio"
                    dictCode="backCheckAccepted"
                    label="是否接受背调"
                    prop="backCheckAccept"
                    {...otherProps}
                />
            </FormContainer>
        </>
    );
};

export default Form3;
